package com.waimai.db.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Order entity. @author MyEclipse Persistence Tools
 */
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
public class Order implements java.io.Serializable {

	// Fields

	private Integer orderId;

	private OrderStatus orderstatus;
	
	private Restaurant restaurant;
	
	private PayMode paymode;
	
	private User user;
	
	private ReceiveAddress receiveaddress;
	
	private Date orderTime;
	private Integer deliveryPrice;
	private Integer deliveryTime;
	private String remark;
	private Float totalPrice;
	
	private Set<OrderFood> orderfoods = new HashSet<OrderFood>(0);
	
	private Comment comment;

	// Constructors

	/** default constructor */
	public Order() {
	}

	/** minimal constructor */
	public Order(OrderStatus orderstatus, Restaurant restaurant,
			PayMode paymode, User user, ReceiveAddress receiveaddress,
			Timestamp orderTime, Integer deliveryPrice, Float totalPrice) {
		this.orderstatus = orderstatus;
		this.restaurant = restaurant;
		this.paymode = paymode;
		this.user = user;
		this.receiveaddress = receiveaddress;
		this.orderTime = orderTime;
		this.deliveryPrice = deliveryPrice;
		this.totalPrice = totalPrice;
	}


	// Property accessors

	public Integer getOrderId() {
		return this.orderId;
	}

	public void setOrderId(Integer orderId) {
		this.orderId = orderId;
	}

	public OrderStatus getOrderstatus() {
		return this.orderstatus;
	}

	public void setOrderstatus(OrderStatus orderstatus) {
		this.orderstatus = orderstatus;
	}

	public Restaurant getRestaurant() {
		return this.restaurant;
	}

	public void setRestaurant(Restaurant restaurant) {
		this.restaurant = restaurant;
	}

	public PayMode getPaymode() {
		return this.paymode;
	}

	public void setPaymode(PayMode paymode) {
		this.paymode = paymode;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public ReceiveAddress getReceiveaddress() {
		return this.receiveaddress;
	}

	public void setReceiveaddress(ReceiveAddress receiveaddress) {
		this.receiveaddress = receiveaddress;
	}

	public Date getOrderTime() {
		return this.orderTime;
	}

	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}

	public Integer getDeliveryPrice() {
		return this.deliveryPrice;
	}

	public void setDeliveryPrice(Integer deliveryPrice) {
		this.deliveryPrice = deliveryPrice;
	}

	public Integer getDeliveryTime() {
		return this.deliveryTime;
	}

	public void setDeliveryTime(Integer deliveryTime) {
		this.deliveryTime = deliveryTime;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Float getTotalPrice() {
		return this.totalPrice;
	}

	public void setTotalPrice(Float totalPrice) {
		this.totalPrice = totalPrice;
	}

	public Comment getComment() {
		return comment;
	}

	public void setComment(Comment comment) {
		this.comment = comment;
	}


	public Set<OrderFood> getOrderfoods() {
		return orderfoods;
	}

	public void setOrderfoods(Set<OrderFood> orderfoods) {
		this.orderfoods = orderfoods;
	}

	@Override
	public String toString() {
		return "Order{" +
				"orderId=" + orderId +
				", orderstatus=" + orderstatus +
				", restaurant=" + restaurant +
				", paymode=" + paymode +
				", user=" + user +
				", receiveaddress=" + receiveaddress +
				", orderTime=" + orderTime +
				", deliveryPrice=" + deliveryPrice +
				", deliveryTime=" + deliveryTime +
				", remark='" + remark + '\'' +
				", totalPrice=" + totalPrice +
				", orderfoods=" + orderfoods +
				", comment=" + comment +
				'}';
	}
}